import instance from '../../utils/request'

// const base = 'http://192.168.1.37:9002/cookcar-plat/'
const base = 'cookcar-plat/'
const sysBase = 'sys-authorize/'

// 获取我的足迹
export function getFootList(data) {
  const config = {
    method: 'get',
    url: `${base}mobile/C/queryFootprint`,
    params: data
  }
  return instance(config)
}

// 获取我的收藏
export function getFavoriteList(data) {
  const config = {
    method: 'get',
    url: `${base}mobile/C/checkCollection`,
    params: data
  }
  return instance(config)
}

// 删除我的足迹
export function deleteFoot(id) {
  const config = {
    method: 'get',
    url: `${base}mobile/C/deleteFootprint/${id}`
  }
  return instance(config)
}

// 删除我的收藏
export function deleteCollection(id) {
  const config = {
    method: 'get',
    url: `${base}mobile/C/deleteCollection/${id}`
  }
  return instance(config)
}

// 点赞视频
export function getLike(id) {
  const config = {
    method: 'get',
    url: `${base}mobile/C/like/${id}`,
  }
  return instance(config)
}

// 增加足迹
export function getFoot(data) {
  const config = {
    method: 'post',
    url: `${base}mobile/C/addFootprint`,
    data
  }
  return instance(config)
}

// 我的寻车管理列表
export function getCarManagementCMyList(data) {
  const config = {
    method: 'get',
    url: `${base}query/carManagementC/myList`,
    params:data
  } 
  return instance(config)
}

// 我的寻车管理列表
export function getCarManagementCMyId(id) {
  const config = {
    method: 'get',
    url: `${base}/query/carManagementC/${id}`,
  }
  return instance(config)
}
// 我的寻车管理列表
export function getCarManagementCCreateOrderC(data) {
  const config = {
    method: 'get',
    url: `${base}/query/carManagementC/createOrder/C`,
    params:data
  }
  return instance(config)
}
// 我的寻车管理列表
export function getOfMortgageIntentionCUadate(data) {
  const config = {
    method: 'get',
    url: `${base}/notice/ofMortgageIntentionC/uadate`,
    params:data
  }
  return instance(config)
}
// 我的寻车管理列表 => 详情
export function getOfMortgageIntentionCId(id) {
  const config = {
    method: 'get',
    url: `${base}/notice/ofMortgageIntentionC/${id}`,
  }
  return instance(config)
}
// 我的寻车管理列表 => 取消订单
export function getCarManagementCCancelOrder(data) {
  const config = {
    method: 'get',
    url: `${base}/query/carManagementC/cancelOrder`,
    params:data
  }
  return instance(config)
}
// 我的寻车管理列表 => 修改订单状态
export function getCarManagementCUpdataStatus(data) {
  const config = {
    method: 'get',
    url: `${base}/query/carManagementC/updataStatus`,
    params:data
  }
  return instance(config)
}

export function mortgageRecord(params) {
  const config = {
    method: 'get',
    url: `${base}mortgage/interestManagementC/`,
	params
  }
  return instance(config)
}



// 获取按揭统计1
export function getMortgageSta1() {
  const config = {
    method: 'get',
    url: `${base}apply/mortgageApplyC/getMortgageStatisticalMapC`,
  }
  return instance(config)
}
// 获取按揭统计2
export function getMortgageSta2(startTime, endTime) {
  const config = {
    method: 'get',
    url: `${base}apply/mortgageApplyC/getMortgageStatisticalListC?endTime=${endTime}&startTime=${startTime}`,
  }
  return instance(config)
}
// 获取寻车统计表
export function getFindCarSta1() {
  const config = {
    method: 'get',
    url: `${base}query/statisticalC/get`,
  }
  return instance(config)
}
// 微信支付
export function getCarManagementCPay(data) {
  const config = {
    method: 'post',
    url: `${base}/query/carManagementC/pay`,
    params:data
  }
  return instance(config)
}

// C端获取用户身份 => 普通用户 => 0，管理员 => 1
export function getUserInfoMyGetInfoC() {
  const config = {
    method: 'get',
    url: `${sysBase}user/infoMy/getInfo/C`
  }
  return instance(config)
}

  // 寻车列表数据加载
export function getCarManagementC(params) {
  const config = {
    method: 'get',
    url: `${base}/query/carManagementC/`,
	params
  }
  return instance(config)
}
// 获取用户id
export function getUserIdData() {
  const config = {
    method: 'get',
    url: `sys-authorize/user/infoMy/getInfo/C`,
  }
  return instance(config)
}
// 按揭意向管理
export function mortgageList(params) {
  const config = {
    method: 'get',
    url: `${base}mortgage/interestManagementC/`,
    params
  }
  return instance(config)
}

// 退款
export function getCarManagementCRefund(data) {
  const config = {
    method: 'get',
    url: `${base}query/carManagementC/refund`,
    params:data
  }
  return instance(config)
}